package com.ytf.test.fifth;

/**
 * @author: YTF
 * @date: 2024/9/18 11:48
 * @version: 1.0
 * @description: 重载的顺序
 */
public class OverloadingOrder {
    static void f(String s, Integer i){
        System.out.println("String: "+s+", int: "+i);
    }
    static void f( Integer i,String s){
        System.out.println("int: "+i+", String: "+s);
    }

    public static void main(String[] args) {
        f("String first",11);
        f(99,"int first");
        /**
         * Output:
         * String: String first, int: 11
         * int: 99, String: int first
         * 建议：
         *  不建议更换参数顺序使方法重载，会让代码难以维护
         */
    }
}
